/**
 * Copyright (c) www.longdw.com
 */
package com.ldw.music.model;

import java.io.Serializable;

public class SentenceModel implements Serializable {
	private static final long serialVersionUID = 20071125L;
	private long fromTime;// 杩欏彞鐨勮捣濮嬫椂闂�鏃堕棿鏄互姣涓哄崟浣�	private long toTime;// 杩欎竴鍙ョ殑缁撴潫鏃堕棿
	private String content;// 杩欎竴鍙ョ殑鍐呭

	public SentenceModel(String content, long fromTime, long toTime) {
		this.content = content;
		this.fromTime = fromTime;
		this.toTime = toTime;
	}

	public SentenceModel(String content, long fromTime) {
		this(content, fromTime, 0);
	}

	public SentenceModel(String content) {
		this(content, 0, 0);
	}

	public long getFromTime() {
		return fromTime;
	}

	public void setFromTime(long fromTime) {
		this.fromTime = fromTime;
	}

	public long getToTime() {
		return toTime;
	}

	public void setToTime(long toTime) {
		this.toTime = toTime;
	}

	/**
	 * 妫�煡鏌愪釜鏃堕棿鏄惁鍖呭惈鍦ㄦ煇鍙ヤ腑闂�	 * 
	 * @param time 鏃堕棿
	 * @return 鏄惁鍖呭惈浜�	 */
	public boolean isInTime(long time) {
		return time >= fromTime && time <= toTime;
	}

	/**
	 * 寰楀埌杩欎竴鍙ョ殑鍐呭
	 * 
	 * @return 鍐呭
	 */
	public String getContent() {
		return content;
	}

	/**
	 * 寰楀埌杩欎釜鍙ュ瓙鐨勬椂闂撮暱搴�姣涓哄崟浣�	 * 
	 * @return 闀垮害
	 */
	public long getDuring() {
		return toTime - fromTime;
	}

	public String toString() {
		return "{" + fromTime + "(" + content + ")" + toTime + "}";
	}
}